import Taro from "@tarojs/taro";
import { memo, useEffect, useState } from "react";
import { ScrollView, Text, View, Image } from "@tarojs/components";
import { Popup, Button, Overlay } from "@nutui/nutui-react-taro";
import { login } from "../../api/user";
import { setStore, getStore } from "../../utils/localStore";
import calssNames from "classnames";
import { iconRightBlack, iconRightGray } from "../../assets/files";
import "./index.scss";

const selectItem = (props) => {
  const { label, value, placeholder, onclick, disabled,required,style,labelStyle,labelClass } = props
  const click = () => {
    if (disabled) {
      return
    }
    onclick()
  }
  return (
    <View className="selectWrap" style={style} onClick={click}>
      {
        required ?
        <Text className="xing">*</Text>
        :
        <Text className="mo"></Text>
      }
      
      <Text className={calssNames(`itemLabel,${labelClass}`)} style={labelStyle}>{label}</Text>
      <Text className="itemValue" style={{color: value ? "#212121" : '#999'}}>{value || placeholder}</Text>
      <Image src={iconRightGray} className="iconRight" />
    </View>
  );
}

export default selectItem;
